package com.ruoyi.shop.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shop.mapper.FoodMapper;
import com.ruoyi.shop.domain.Food;
import com.ruoyi.shop.service.IFoodService;

/**
 * 食品表Service业务层处理
 * 
 * @author teio
 * @date 2024-06-04
 */
@Service
public class FoodServiceImpl implements IFoodService 
{

    @Autowired
    private FoodMapper foodMapper;

    /**
     * 查询食品表
     * 
     * @param fid 食品表主键
     * @return 食品表
     */
    @Override
    public Food selectFoodByFid(Long fid)
    {

        return foodMapper.selectFoodByFid(fid);
    }

    /**
     * 查询食品表列表
     * 
     * @param food 食品表
     * @return 食品表
     */
    @Override
    public List<Food> selectFoodList(Food food)
    {

        return foodMapper.selectFoodList(food);
    }

    /**
     * 新增食品表
     * 
     * @param food 食品表
     * @return 结果
     */
    @Override
    public int insertFood(Food food)
    {
        return foodMapper.insertFood(food);
    }

    /**
     * 修改食品表
     * 
     * @param food 食品表
     * @return 结果
     */
    @Override
    public int updateFood(Food food)
    {
        return foodMapper.updateFood(food);
    }

    /**
     * 批量删除食品表
     * 
     * @param fids 需要删除的食品表主键
     * @return 结果
     */
    @Override
    public int deleteFoodByFids(Long[] fids)
    {
        return foodMapper.deleteFoodByFids(fids);
    }

    /**
     * 删除食品表信息
     * 
     * @param fid 食品表主键
     * @return 结果
     */
    @Override
    public int deleteFoodByFid(Long fid)
    {
        return foodMapper.deleteFoodByFid(fid);
    }
}
